import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';

const constantRoutes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'layout',
        component: () => import('@/pages/layout/index.vue'),
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/pages/login/index.vue'),
    },
    {
        path: '/404',
        name: '404',
        component: () => import('@/pages/error-page/404.vue'),
    },
];
export const asyncRoutes: any = [];
export const router = createRouter({
    history: createWebHistory(),
    routes: constantRoutes,
});
export function resetRouter() {
    asyncRoutes.forEach((route: any) => {
        router.removeRoute(route.name);
    });
}
